#include <iostream>
using namespace std;

int main()
{
    //1、前置递增
    int a = 10;
    ++a;
    cout << "a = " << a << endl;

    //2、后置递增
    int b = 20;
    b++;
    cout << "b = " << b << endl;

    //3、前置递增与后置递增的区别：
    //前置递增 先让变量+1 然后进行表达式的运算
    int a2 = 30;
    int b2 = ++a2 * 100;
    cout << "a2 = " << a2 << endl;
    cout << "b2 = " << b2 << endl;

    //后置递增 先进行表达式的运算 然后让变量+1
    int a3 = 30;
    int b3 = a3++ * 100;
    cout << "a3 = " << a3 << endl;
    cout << "b3 = " << b3 << endl;
    
    return 0;
}